<!-- <template>
  <div class="production-plan-container">
    <!-- 搜索表单 -->
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item label="关联项目">
        <el-input v-model="queryParams.relatedProject" placeholder="请输入关联项目" clearable />
      </el-form-item>
      <el-form-item label="生产计划编号">
        <el-input v-model="queryParams.planNumber" placeholder="请输入计划编号" clearable />
      </el-form-item>
      <el-form-item label="计划主题">
        <el-input v-model="queryParams.planTheme" placeholder="请输入计划主题" clearable />
      </el-form-item>
      <el-form-item label="满意人员">
        <el-input v-model="queryParams.satisfiedPerson" placeholder="请选择满意人" clearable>
          <template #suffix>
            <el-icon><Search /></el-icon>
          </template>
        </el-input>
      </el-form-item>
      <el-form-item label="满意日期">
        <el-date-picker
          v-model="queryParams.satisfiedDate"
          type="date"
          placeholder="选择日期"
          format="YYYY-MM-DD"
          value-format="YYYY-MM-DD"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleQuery">查询</el-button>
      </el-form-item>
    </el-form>

    <!-- 工具栏 -->
    <div class="toolbar">
      <el-button type="primary" @click="handleAdd">新增</el-button>
      <el-button type="primary" @click="handleModify">修改</el-button>
      <el-button type="primary" @click="handleDelete">删除</el-button>
      <el-button type="primary" @click="handleReview">过滤</el-button>
      <el-button type="primary" @click="handleTransfer">迁移</el-button>
      <el-dropdown>
        <el-button type="primary">
          打印<el-icon class="el-icon--right"><arrow-down /></el-icon>
        </el-button>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item @click="handlePrint('current')">打印当前</el-dropdown-item>
            <el-dropdown-item @click="handlePrint('selected')">打印选中</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
      <el-button type="primary" @click="handleImport">导入</el-button>
      <el-button type="primary" @click="handleExport">导出</el-button>
      <el-button type="primary" @click="handleCheck">查看日志</el-button>
    </div>

    <!-- 数据表格 -->
    <el-table
      v-loading="loading"
      :data="tableData"
      @selection-change="handleSelectionChange"
      style="width: 100%"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column type="index" label="序号" width="60" />
      <el-table-column prop="planNumber" label="生产计划编号" width="150" />
      <el-table-column prop="planTheme" label="生产计划主题" min-width="200" />
      <el-table-column prop="relatedProject" label="关联项目" min-width="150" />
      <el-table-column prop="planQuantity" label="本次生产计划数量" width="150" align="right" />
      <el-table-column prop="completedQuantity" label="已下生产数量" width="150" align="right" />
      <el-table-column prop="status" label="生产计划状态" width="120">
        <template #default="{ row }">
          <el-tag :type="getStatusType(row.status)">{{ row.status }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="creator" label="制单人员" width="120" />
      <el-table-column prop="createDate" label="制单日期" width="120" />
      <el-table-column fixed="right" label="操作" width="180">
        <template #default="{ row }">
          <el-button link type="primary" @click="handleDetail(row)">详细信息</el-button>
          <el-button link type="primary" @click="handleProduce(row)">生产订单</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <div class="pagination">
      <el-pagination
        v-model:current-page="queryParams.pageNum"
        v-model:page-size="queryParams.pageSize"
        :page-sizes="[10, 20, 30, 50]"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>

    <!-- 新增/修改弹窗 -->
    <el-dialog
      v-model="dialog.visible"
      :title="dialog.title"
      width="800px"
      append-to-body
    >
      <el-form
        ref="formRef"
        :model="form"
        :rules="rules"
        label-width="120px"
      >
        <el-form-item label="关联生产计划" prop="relatedPlan">
          <el-input v-model="form.relatedPlan" placeholder="请输入关联生产计划">
            <template #suffix>
              <el-icon><Search /></el-icon>
            </template>
          </el-input>
        </el-form-item>
        <el-form-item label="单据主题" prop="theme" required>
          <el-input v-model="form.theme" placeholder="请输入单据主题" />
        </el-form-item>
        <el-form-item label="单据编号">
          <el-input v-model="form.documentNumber" placeholder="保存后自动生成" disabled />
        </el-form-item>
        <el-form-item label="关联项目" prop="project">
          <el-input v-model="form.project" placeholder="请选择关联项目">
            <template #suffix>
              <el-icon><Search /></el-icon>
            </template>
          </el-input>
        </el-form-item>
        <el-form-item label="制单人员">
          <el-input v-model="form.creator" disabled />
        </el-form-item>
        <el-form-item label="制单日期">
          <el-date-picker
            v-model="form.createDate"
            type="date"
            placeholder="选择日期"
            disabled
          />
        </el-form-item>
        <el-form-item label="备注">
          <el-input
            v-model="form.remark"
            type="textarea"
            placeholder="请输入备注信息"
            :rows="3"
          />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="dialog.visible = false">取 消</el-button>
        </div>
      </template>
    </el-dialog> -->
